<table>
  <thead>
    <tr>
      <th>Runner</th>
      <th>M/F</th>
      <th>Birthdate</th>
      <th>Level</th>
      <th>T-Shirt size</th>
      <th>Shoe size</th>
      <th>Goal</th>
      <th>Miles</th>
      <th class="last"></th>
      <th class="last"></th>
    </tr>
  </thead>
  <tbody>
    <% if @runners.blank? %>
      <td colspan="10" class="no_results">There are no runners added yet.</p>
    <% else %>
      <% @runners.each do |runner| %>
        <tr class="<%= cycle('odd', 'even') %>">
          <td><%= link_to h(runner.name), runner %></td>
          <td><%=h runner.gender %></td>
          <td><%= format_date(runner.birthdate) %></td>
          <td><%=h runner.level %></td>
          <td><%=h runner.shirt_size %></td>
          <td><%=h runner.shoe_size %></td>
          <td><%= runner.goal %></td>
          <td><%= runner.distance_cache %></td>
          <td><%= runner.percent_complete %>%</td>
          <td class="last">
          <%if self.current_user.can('edit:runner', runner) %>
            <%= link_to(image_tag('icons/pencil.png', :alt => 'Edit'), edit_runner_path(runner)) %>
          <%end%>
          <%if self.current_user.can('delete:runner', runner) %>
            <%= link_to(image_tag('icons/cross.png', :alt => 'Delete'), runner, :confirm => 'Are you sure?', :method => :delete) %>
          <%end%>
          </td>
          <td class="last">
            <%= render(:partial => "shared/progress_small", :locals => { :distance => runner.distance_cache, :goal => runner.goal }) %>
          </td>

        </tr>
      <% end %>
    <% end %>
  </tbody>
</table>

<%if self.current_user.can('create:runner', @group) %>
<p>
  <%= link_to 'Add new runner', {:controller => 'runners', :action => 'new', :group_id => @group.id} %>
  | <%= link_to 'Group Update', bulk_update_path  %></p>
</p>
<%end%>